﻿using Lsk.Data;
using Lsk.Business.DTO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Entity.Core.Objects;
namespace Lsk.Business
{
    public class RecentTransaction
    {
        private lskEntities _entity;

        public RecentTransaction()
        {
            _entity = new lskEntities();
        }

        public IEnumerable<String> GetDistrict()
        {
            IEnumerable<String> result = _entity.GetRecentSalePropertyDaerah();

            return result;
        }

        public IEnumerable<GetRecentSaleProperty_Result> GetRecentSaleProperty(String addressKeyword, String propertyType, String daerah)
        {            
            IEnumerable<GetRecentSaleProperty_Result> result = _entity.GetRecentSaleProperty(addressKeyword,propertyType,daerah,100,0);
            return result;
        }

        public IEnumerable<GetRecentSalePropertyLsk1_Result> GetRecentSalePropertyLSK(String addressKeyword, String propertyType, String daerah, long userID)
        {
            IEnumerable<GetRecentSalePropertyLsk1_Result> result = _entity.GetRecentSalePropertyLsk1(addressKeyword, propertyType, daerah, 50, userID);
            return result;
        }

        public IEnumerable<GetRecentRentProperty_Result> GetRecentRentProperty(String addressKeyword, String propertyType, String daerah)
        {
            IEnumerable<GetRecentRentProperty_Result> result = _entity.GetRecentRentProperty(addressKeyword, propertyType, daerah, 100, 0);
            return result;
        }

        public IEnumerable<GetRecentRentPropertyLsk1_Result> GetRecentRentPropertyLSK(String addressKeyword, String propertyType, String daerah, long userID)
        {
            IEnumerable<GetRecentRentPropertyLsk1_Result> result = _entity.GetRecentRentPropertyLsk1(addressKeyword, propertyType, daerah, 50, userID);
            return result;
        }
    }
}
